<template>
  <div>
    <div class="search-group" v-if="this.path == 'Warehousing-page1'">
      <div class="search-gropu-item">
        <label>入库单号</label>
        <el-input v-model="listQuery.rukudh" placeholder="请输入"></el-input>
      </div>
      <div class="search-gropu-item">
        <label>名称</label>
        <el-input v-model="listQuery.mingcheng" placeholder="请输入"></el-input>
      </div>
      <div class="search-gropu-item">
        <label>入库类型</label>
        <el-select
          v-model="listQuery.rukulx"
          @change="dataUpdate"
          placeholder="请选择"
        >
          <el-option
            v-for="(item, index) in $util.getWzqf()"
            :key="index"
            :label="item.name"
            :value="item.id"
          ></el-option>
        </el-select>
      </div>
      <div class="search-gropu-item">
        <label>状态</label>
        <el-select
          v-model="listQuery.zhuangtai"
          @change="dataUpdate"
          placeholder="请选择"
        >
          <el-option
            v-for="(item, index) in $util.getRkzt()"
            :key="index"
            :label="item.name"
            :value="item.id"
          ></el-option>
        </el-select>
      </div>
      <!-- <div class="search-gropu-item">
        <label>入库类型</label>
        <el-select v-model="listQuery.rukulx" @change="dataUpdate" placeholder="请选择">
          <el-option v-for="(item, index) in $util.getRklx()" :key="index" :label="item.name"
            :value="item.id"></el-option>
        </el-select>
      </div> -->
      <!-- <div class="search-gropu-item">
        <label>创建时间</label>
        <el-date-picker v-model="listQuery.startTime" type="date" value-format="yyyy-MM-dd" placeholder="选择日期">
        </el-date-picker>
        <el-date-picker v-model.trim="listQuery.create_time" size="small" type="datetimerange" range-separator="-"
          start-placeholder="开始时间" end-placeholder="结束时间" value-format="yyyy-MM-dd HH:mm:ss" :editable="false" />
      </div> -->
      <div class="search-button">
        <el-button type="primary" icon="el-icon-search" @click="search">
          查询
        </el-button>
        <el-button icon="el-icon-refresh" @click="resetlist">重置</el-button>
      </div>
    </div>
    <div class="search-group" v-if="this.path == 'Warehousing-page2'">
      <div class="search-gropu-item">
        <label>入库单号</label>
        <el-input v-model="listQuery.rukudh" placeholder="请输入"></el-input>
      </div>
      <div class="search-gropu-item">
        <label>任务单号</label>
        <el-input v-model="listQuery.renwudh" placeholder="请输入"></el-input>
      </div>
      <!-- <div class="search-gropu-item">
        <label>起始点</label>
        <el-input v-model="listQuery.qishid" placeholder="请输入"></el-input>
      </div> -->
      <!-- <div class="search-gropu-item">
        <label>终结点</label>
        <el-input v-model="listQuery.zhongjied" placeholder="请输入"></el-input>
      </div> -->
      <div class="search-gropu-item">
        <label>入库任务状态</label>
        <el-select
          v-model="listQuery.zhuangtai"
          @change="dataUpdate"
          placeholder="请选择"
        >
          <el-option
            v-for="(item, index) in $util.getSjzt()"
            :key="index"
            :label="item.name"
            :value="item.id"
          ></el-option>
        </el-select>
      </div>
      <div class="search-gropu-item">
        <label>托盘号</label>
        <el-input v-model="listQuery.tuopanh" placeholder="请输入"></el-input>
      </div>
      <div class="search-gropu-item">
        <label>货位号</label>
        <el-input v-model="listQuery.huoweih" placeholder="请输入"></el-input>
      </div>
      <div class="search-gropu-item">
        <label>挂架码</label>
        <el-input v-model="listQuery.guajiam" placeholder="请输入"></el-input>
      </div>
      <div class="search-button">
        <el-button type="primary" icon="el-icon-search" @click="search">
          查询
        </el-button>
        <el-button icon="el-icon-refresh" @click="resetlist">重置</el-button>
      </div>
    </div>
  </div>
</template>
<script>
  export default {
    name: 'Test',
    data() {
      return {
        show: true,
        Wzzylist: [],
        Zgdwlist: [],
      }
    },
    props: {
      listQuery: {
        type: Object,
        default: {},
        required: true,
      },
      path: {
        type: String,
        default: null,
        require: true,
      },
    },
    created() {},
    async mounted() {
      this.Wzzylist = await this.$util.getWzzy()
      this.Zgdwlist = await this.$util.getZgdw()
      // let data = this.$util.getWzqf()
      // let data2 = this.$util.getRkzt()
      // let data3 = this.$util.getRklx()
      // this.listQuery.wuziqf = data[0].id
      // this.listQuery.zhuguandwid = this.Zgdwlist[0].id
      this.listQuery.wuzizy = this.Wzzylist[0].zhuanyeid
      // this.listQuery.danjuzt = data2[0].id
      // this.listQuery.rukulx = data3[0].id
      this.$forceUpdate()
      // this.search()
    },
    methods: {
      dataUpdate() {
        this.$forceUpdate()
      },
      search() {
        this.$parent.search()
      },
      resetlist() {
        this.$parent.resetlist()
      },
    },
  }
</script>
<style lang="scss" scoped>
  .search-group {
    display: flex;
    flex-flow: row wrap;

    .search-gropu-item {
      padding: 10px 20px;
      width: calc((100% - 20px * 8) / 4);
      display: flex;

      label {
        width: 0.8rem;
        white-space: nowrap;
        line-height: 0.32rem;
        margin-right: 0.1rem;
      }

      .el-select {
        width: 100%;
      }
    }

    .search-gropu-item-time {
      width: 100% !important;
      padding: 10px 20px;
      display: flex;

      label {
        white-space: nowrap;
        line-height: 32px;
        margin-right: 10px;
      }
    }

    .search-button {
      margin-left: auto;
      padding: 0.1rem 0.2rem;

      .el-button {
        font-size: 0.14rem !important;
      }
    }
  }

  ::v-deep {
    .el-date-editor {
      width: 100% !important;
    }
  }
</style>
